#pragma once

#include "RenderTypes.h"


struct IShader;
struct ITexture;
struct IVertexBuffer;
struct IIndexBuffer;

struct IRenderAPI
{
	virtual ~IRenderAPI() {}

	virtual bool Init() = 0;

	virtual IShader* CreateShader(const char* name) = 0;

	virtual ITexture* CreateTexture(uint width, uint height, uint levels, ETextureFormat format, bool dynamic) = 0;
	virtual ITexture* CreateTexture(const char* filepath, uint width, uint height, uint levels, ETextureFormat format, bool dynamic) = 0;

	virtual IIndexBuffer* CreateIndexBuffer(uint length, bool dynamic) = 0;
	virtual IVertexBuffer* CreateVertexBuffer(uint length, bool dynamic) = 0;

	virtual void StartRendering() = 0;
	virtual void FinishRendering() = 0;
	virtual void SwapBuffers() = 0;

	virtual void ClearBuffer(uint flags, const Color& color, float z) = 0;
	virtual void SetShader(IShader* pShader) = 0;
	virtual void SetTexture(ITexture* pTexture) = 0;
	virtual void DrawPrimitives(EPrimitiveType ptype, const IVertexBuffer* vertices, uint16 vertex_count,	const IIndexBuffer* indices, uint16 index_count) = 0;
};

